package com.liuqi.openai.core.client;

import com.liuqi.openai.core.chat.ChatCompletionRequest;
import com.liuqi.openai.core.chat.ChatCompletionResponse;
import com.liuqi.openai.core.completion.CompletionRequest;
import com.liuqi.openai.core.completion.CompletionResponse;
import com.liuqi.openai.core.embedding.EmbeddingRequest;
import com.liuqi.openai.core.embedding.EmbeddingResponse;

/**
 * openai api 接口, 返回执行器
 *
 * @author liuqi
 * @date 2025/7/18
 **/
public interface OpenAiClient {

    /**
     * 创建 url = /completions的执行器
     *
     * <p>
     *     文本生成
     * </p>
     *
     */
    Executor<CompletionResponse> completion(CompletionRequest request);

    /**
     * 创建 url = /chat/completions的执行器
     *
     * <p>
     *     对话, 聊天
     * </p>
     */
    Executor<ChatCompletionResponse> chatCompletion(ChatCompletionRequest request);

    /**
     * 创建 url = /embeddings的执行器
     *
     * <p>
     *     文本向量化
     * </p>
     */
    Executor<EmbeddingResponse> embedding(EmbeddingRequest request);

}
